using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter07
{
	/// <summary>
	/// Example02: The Scalar Product
	/// The vectors A and B are given 
	/// by A = 2i + 3j and B = -i + 2j.  
	/// (A) Determine the scalar product A.B  
	/// 4
	/// (B) Find the angle \theta between A and B.
	/// 60.2^{\circle}
	/// </summary>
	public class Example02
	{
		public Example02()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Vector A = (2.0*L.UnitVector.i)+(3.0*L.UnitVector.j);
			L.Vector B = (-1.0*L.UnitVector.i)+(2.0*L.UnitVector.j);
            L.Scalar s = A * B;
			result += Convert.ToString(s.Magnitude);
			double theta = Math.Acos((A*B).Magnitude/A.Norm/B.Norm)
				*180.0/Math.PI;
			result +="   "+Convert.ToString(theta);
		}
	}
}
